using AutoMapper;
using RBAC.Domain.Department;
using RBAC.Domain.Dto.Output;
using RBAC.Domain.MaterialManage;
using RBAC.Domain.RBAC;
using RBAC.Domain.SalesManage;

namespace RBAC.Read.Api
{
    /// <summary>
    /// AutoMapper实体映射配置类
    /// 用于配置领域实体与数据传输对象(DTO)之间的映射关系
    /// </summary>
    public class RBACAutoMapper : Profile
    {
        /// <summary>
        /// 构造函数，配置所有实体映射关系
        /// </summary>
        public RBACAutoMapper()
        {
            // 权限
            CreateMap<PermissionModel, GetPermissionListDto>();
            CreateMap<PermissionModel, PermissionDto>();

            // 用户
            CreateMap<UserModel, UserDto>();

            // 角色
            CreateMap<RoleModel, GetRoleListDto>();

            // 销售订单映射
            CreateMap<SalesOrder, SalesOrderDto>();
            CreateMap<SalesOrderDetail, SalesOrderDetailItemDto>();

            // 部门
            CreateMap<DepartmentManagement, GetDepartmentListDto>();

            // 物料分类
            CreateMap<MaterType, GetMaterTypeListDto>();
        }
    }
}
